package com.example.demo.core;

import com.example.demo.entity.listener.OrderEvent;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author xkx
 * @version 1.0.0
 * @datetime 2019/1/22 15:40
 * @description
 */
@Component
public class OrderEventListener {

  @Async
  @EventListener
  public void handleOrderEvent(OrderEvent event) {
    System.out.println("我监听到了handleOrderEvent发布的message为:" + event.getMsg());
  }
}
